Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-14373] Introduce SecurityTask database table and repository #5025

Merged
merged 11 commits into from
Nov 14, 2024

Conversation

shane-melton
Copy link
Member

@shane-melton shane-melton commented Nov 12, 2024

🎟️ Tracking

PM-14373

📔 Objective

Introduce the new SecurityTask entity and initial repositories.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@shane-melton shane-melton changed the title Vault/pm 14373/add security tasks entity [PM-14373] Introduce SecurityTasks database table and repository Nov 12, 2024
@shane-melton shane-melton changed the title [PM-14373] Introduce SecurityTasks database table and repository [PM-14373] Introduce SecurityTask database table and repository Nov 12, 2024
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 53.65854% with 19 lines in your changes missing coverage. Please review.

Project coverage is 42.68%. Comparing base (702a81b) to head (8ada50c).
Report is 9 commits behind head on main.

Files with missing lines Patch % Lines
src/Core/Vault/Entities/SecurityTask.cs 0.00% 10 Missing ⚠️
...apper/Vault/Repositories/SecurityTaskRepository.cs 0.00% 4 Missing ⚠️
...cture.EntityFramework/Vault/Models/SecurityTask.cs 66.66% 2 Missing ⚠️
...ework/Vault/Repositories/SecurityTaskRepository.cs 0.00% 2 Missing ⚠️
...ucture.Dapper/DapperServiceCollectionExtensions.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5025      +/-   ##
==========================================
+ Coverage   42.58%   42.68%   +0.09%     
==========================================
  Files        1406     1411       +5     
  Lines       65074    65131      +57     
  Branches     5962     5969       +7     
==========================================
+ Hits        27715    27804      +89     
+ Misses      36131    36082      -49     
- Partials     1228     1245      +17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Nov 12, 2024

Logo
Checkmarx One – Scan Summary & Details468749af-5276-462e-8448-235df038ff33

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 92 Attack Vector
LOW Heap_Inspection /src/Core/Constants.cs: 129 Attack Vector
LOW Use_Of_Hardcoded_Password /src/Core/Constants.cs: 129 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 153
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 168
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 160
MEDIUM Unpinned Actions Full Length Commit SHA /repository-management.yml: 96
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 168
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 96
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 153
LOW Unpinned Actions Full Length Commit SHA /repository-management.yml: 160

@shane-melton shane-melton marked this pull request as ready for review November 13, 2024 00:15
@shane-melton shane-melton requested review from a team as code owners November 13, 2024 00:15
src/Core/Vault/Entities/SecurityTask.cs Show resolved Hide resolved
src/Core/Vault/Enums/SecurityTaskType.cs Outdated Show resolved Hide resolved
src/Core/Vault/Enums/SecurityTaskType.cs Outdated Show resolved Hide resolved
@@ -0,0 +1,11 @@
CREATE PROCEDURE [dbo].[SecurityTask_DeleteById]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Is this even doable? I'd think we don't support it. I get that orgs or ciphers would cascade a delete, but we wouldn't directly delete a task.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a great point, I had added the delete sproc to complete the base Repository implementation. But, you're right that we don't currently plan to support deleting a specific task at this time.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ how do we plan on maintaining the SecurityTask table?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed SecurityTask_DeleteById in cef36f1

@gbubemismith I believe the intention is to leave Tasks around for historical reporting so they won't be removed unless the organization. Otherwise, I imagine we could create background jobs that periodically clean up old/completed tasks if that's desired eventually.

src/Sql/Vault/dbo/Tables/SecurityTask.sql Show resolved Hide resolved
Copy link
Member

@gbubemismith gbubemismith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good

@shane-melton shane-melton merged commit eee7494 into main Nov 14, 2024
56 checks passed
@shane-melton shane-melton deleted the vault/pm-14373/add-security-tasks-entity branch November 14, 2024 22:54
vgrassia pushed a commit to vgrassia/server that referenced this pull request Nov 21, 2024
…arden#5025)

* [PM-14373] Introduce SecurityTask entity and related enums

* [PM-14373] Add Dapper SecurityTask repository

* [PM-14373] Introduce MSSQL table, view, and stored procedures

* [PM-14373] Add EF SecurityTask repository and type configurations

* [PM-14373] Add EF Migration

* [PM-14373] Add integration tests

* [PM-14373] Formatting

* Typo

Co-authored-by: Matt Bishop <[email protected]>

* Typo

Co-authored-by: Matt Bishop <[email protected]>

* [PM-14373] Remove DeleteById sproc

* [PM-14373] SQL formatting

---------

Co-authored-by: Matt Bishop <[email protected]>
vgrassia pushed a commit to vgrassia/server that referenced this pull request Nov 21, 2024
…arden#5025)

* [PM-14373] Introduce SecurityTask entity and related enums

* [PM-14373] Add Dapper SecurityTask repository

* [PM-14373] Introduce MSSQL table, view, and stored procedures

* [PM-14373] Add EF SecurityTask repository and type configurations

* [PM-14373] Add EF Migration

* [PM-14373] Add integration tests

* [PM-14373] Formatting

* Typo

Co-authored-by: Matt Bishop <[email protected]>

* Typo

Co-authored-by: Matt Bishop <[email protected]>

* [PM-14373] Remove DeleteById sproc

* [PM-14373] SQL formatting

---------

Co-authored-by: Matt Bishop <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants